// 注册全局过滤器
import Vue from 'vue'

Vue.filter('formatDate', function (data) {
  // 先转成毫秒
  const dateObj = new Date(data * 1000)
  const y = dateObj.getFullYear()
  const m = dateObj.getMonth() + 1
  const d = dateObj.getDate() + 1
  const h = dateObj.getHours()
  const s = dateObj.getMinutes()
  return `${y}-${m}-${d} ${h}:${s}`
})
